package org.example.lock;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class CallMain {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallAble myCallAble = new MyCallAble();
        FutureTask<String> task = new FutureTask<>(myCallAble);
        Thread t1 = new Thread(task);
        t1.start();
        System.out.println("准备获取结果");
        String result = task.get();
        System.out.println("获取到结果："+result);
    }
}
